<!--main-->
<div id="wrapper"> 
	<fieldset>
		<legend>
    <%= link_to '分类管理', nodes_path %>
    <%= link_to '添加文章', new_topic_path %>
    </legend>
      <table style="width:100%" class="table table-bordered">
        <thead>
          <th width="450px">标题</th>
          <th>状态</th>
          <th>发布</th>
          <th>管理</th>
        </thead>
        <tbody>
        <% @topics.each do |t| %>
          <tr>
            <td><%= t.title %></td>
            <td>
            <% if t.category == 1 %>综合新闻
            <% elsif t.category == 2 %>官方新闻
            <% elsif t.category == 3 %>游戏公告
            <% elsif t.category == 4 %>维护公告
            <% end %>
            </td>
            <td><%= t.created_at.strftime('%Y-%m-%d %H:%M:%S').to_s %></td>
            <td>
            <%= link_to edit_topic_path(t.id), :class => 'ddm' do %>
              <span class="icon icon145"></span>
            <% end %>
            <%= link_to topic_path(t.id), :method => :delete, :confirm => '确定删除此记录吗?', :class => 'ddm' do %>
              <span class="icon icon186"></span>
            <% end %>
            </td>
          </tr>
          <% end %>
        </tbody>
        <tr><td colspan='4'><%= will_paginate @topics %></td></tr>
      </table>
      </fieldset>
      </div>
